#include<iostream>
using namespace std;
class Base
{
	public:
		int a;
		Base(int x)
		{
			a = x;
		}
		void Print()
		{
			cout << "Base::a = " << a << endl;
		}
};
class Derived :public Base
{
public:
	int a;
	Derived(int x, int y) :Base(x)
	{
		a = y;
		Base::a *= 2;
	}
	void Print()
	{
		Base::Print();
		cout << "Dericved::a =" << a << endl;
	}
};
void f1(Base& obj)
{
	obj.Print();
}
void f2(Derived& obj)
{
	obj.Print();
}
int main(void)
{
    Derived d(200, 300);
	d.a = 400;
	d.Print();
	d.Base::a = 200;
	d.Base::Print();
	Base* pd = &d;
	pd->Print();
	f1(d);
	Derived* pb = &d;
	pb->Print();
	f2(d);
	return 0;















}